<template>
  <div>
    <headerNav />
    <div class="mindWidth container">
      <div class="nav">
        <span @click="$router.push('/')">首页</span> >
        <span @click="$router.push('/demandList')">成果需求</span> >
        <span>详情</span>
      </div>
      <div class="content">
        <div class="name">{{detailInfo.name}}</div>
        <div class="content-info">{{detailInfo.introduce}}</div>
      </div>
      <div class="information flex items-middle">
        <div>
          <span>联系人：</span>
          {{detailInfo.contacts}}
        </div>
        <div>
          <span>联系电话：</span>
          {{detailInfo.phoneNumber}}
        </div>
      </div>
    </div>
    <navigation />
    <footerNav />
  </div>
</template>
<script>
import { demandDetail } from "../../api/api.js";
export default {
  data() {
    return {
      id: this.$route.params.id,
      detailInfo: {}
    };
  },
  head() {
    return {
      title: `${this.detailInfo.name}-比目镜`,
      meta: [
        { hid: "keywords", name: "keywords", content: this.detailInfo.name },
        {
          hid: "description",
          name: "description",
          content: this.detailInfo.name
        }
      ]
    };
  },
  async asyncData({ app, route, err }) {
    let id = route.params.id;
    let { result } = await demandDetail({ id: id });
    // console.log(5555555, result);
    return {
      detailInfo: result
    };
  },
  mounted() {
    // this.getDetail();
  },
  methods: {
    // getDetail() {
    //   demandDetail({ id: this.id }).then(res => {
    //     this.detailInfo = res.result;
    //   });
    // }
  }
};
</script>
<style lang="less" scoped>
.container {
  min-height: 600px;
  .nav {
    width: 100%;
    height: 50px;
    line-height: 50px;
    span {
      font-size: 14px;
      color: #333;
      margin: 0 10px;
      cursor: pointer;
    }
  }
  .content {
    .name {
      font-size: 18px;
      font-weight: 600;
      padding: 20px 0;
    }
    .content-info {
      min-height: 180px;
      width: 75%;
      text-indent: 32px;
      line-height: 25px;
    }
  }
  .information {
    margin-bottom: 20px;
    span {
      font-size: 16px;
      color: #aaa;
    }
    div {
      margin-bottom: 15px;
      font-size: 18px;
      font-weight: 600;
      margin-right: 20px;
    }
  }
}
</style>
